<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <style>
        table,td,th{
            border-collapse: collapse;
        }
        td,th{
            border: 1px solid #ccc;
            width: 120px;
            height: 30px;
        }
    </style>
</head>
<body>
    <h1>用户列表</h1>
    <table id="userTable">
        <thead>
            <tr>
                <th>ID</th>
                <th>用户名</th>
                <th>邮箱</th>
            </tr>
        </thead>
        <tbody id="outer">
            <!-- 用户数据将被填充到这里 -->
        </tbody>
    </table>

    <script src="/dev/plugins/jquery/jquery.min.js"></script>
    <script>
        $(function(){
            $.getJSON('/dev/data/users.json',function(res){
                if(res.code==200){//请求成功
                    let outer = document.getElementById("outer")
                    let arr = res.data;
                    //遍历这个数组
                    for(let i=0;i<arr.length;i++){
                        let tr = document.createElement("tr");

                        let td01 = document.createElement("td");
                        td01.innerHTML=arr[i].id

                        let td02 = document.createElement("td");
                        td02.innerHTML=arr[i].username

                        let td03 = document.createElement("td");
                        td03.innerHTML=arr[i].email

                        tr.append(td01)
                        tr.append(td02)
                        tr.append(td03)

                        outer.append(tr);
                    }
                }
            })
        })
    </script>
</body>
</html>